<?php
if(!defined('ADMINPX') || !defined('ADMIN')) {
	exit('Access Denied');
}
$act=$_GET['act'];
if($act =='upload'){
$upload_config_fjlx=Bingz_config('upload_config_fjlx');
$upload_config_fjlxdx=Bingz_config('upload_config_fjlxdx');
$upload_config_tplx=Bingz_config('upload_config_tplx');
$upload_config_tplxdx=Bingz_config('upload_config_tplxdx');
$upload_config_tpwidth=Bingz_config('upload_config_tpwidth');
$upload_config_tpheight=Bingz_config('upload_config_tpheight');


if(Bingz_config('upload_config_sysz') == '1'){$upload_config_sysz='CHECKED';}else{$upload_config_sysza='CHECKED';}
if(Bingz_config('upload_config_sydz') == '1'){$upload_config_sydz='CHECKED';}elseif(Bingz_config('upload_config_sydz') == '2'){$upload_config_sydza='CHECKED';}elseif(Bingz_config('upload_config_sydz') == '3'){$upload_config_sydzb='CHECKED';}elseif(Bingz_config('upload_config_sydz') == '4'){$upload_config_sydzc='CHECKED';}
$upload_config_syname=Bingz_config('upload_config_syname');

echo <<<end
<div class="admin">==上传配置==<br/></div>
<form method="POST" action="admin.php?action=setting&act=uploadok">
文件类型:<input  class="text" type="text" name="upload_config_fjlx" value="$upload_config_fjlx"/>(用,号隔开)<br/>
文件上传限制:<input  class="text" type="text" name="upload_config_fjlxdx" value="$upload_config_fjlxdx"/> kb<br/>
图片类型:<input  class="text" type="text" name="upload_config_tplx" value="$upload_config_tplx"/>(用,号隔开)<br/>
图片上传限制:<input  class="text" type="text" name="upload_config_tplxdx" value="$upload_config_tplxdx"/> kb<br/>
图片缩小width:<input  class="text" type="text" name="upload_config_tpwidth" value="$upload_config_tpwidth"/>px (0不设置)<br/>
图片缩小height:<input  class="text" type="text" name="upload_config_tpheight" value="$upload_config_tpheight"/>px (0不设置)<br/>
水印设置: 
<input type="radio" $upload_config_sysz name="upload_config_sysz" value="1" />开启
<input type="radio" $upload_config_sysza name="upload_config_sysz" value="2" />关闭<br/>
水印位置: 
<input type="radio" $upload_config_sydz name="upload_config_sydz" value="1" />左上角
<input type="radio" $upload_config_sydza name="upload_config_sydz" value="2" />右上角
<input type="radio" $upload_config_sydzb name="upload_config_sydz" value="3" />左下角
<input type="radio" $upload_config_sydzc name="upload_config_sydz" value="4" />右下角<br/>
水印图标地址:<input  class="text" type="text" name="upload_config_syname" value="$upload_config_syname"/><br/>

<input class="submit" type="submit" name="adminpost" value="提交配置"/>
</form>
end;
}else if($act=='uploadok'){
   if(!$_POST[adminpost]){
	   echo"提交出错<br/>";
	 }else{
	   Bingz_config('upload_config_tpwidth',$_POST['upload_config_tpwidth'],'post');
	   Bingz_config('upload_config_tpheight',$_POST['upload_config_tpheight'],'post');
	   Bingz_config('upload_config_fjlx',$_POST['upload_config_fjlx'],'post');
	   Bingz_config('upload_config_fjlxdx',$_POST['upload_config_fjlxdx'],'post');
	   Bingz_config('upload_config_tplx',$_POST['upload_config_tplx'],'post');
	   Bingz_config('upload_config_tplxdx',$_POST['upload_config_tplxdx'],'post');
	   Bingz_config('upload_config_sysz',$_POST['upload_config_sysz'],'post');
	   Bingz_config('upload_config_sydz',$_POST['upload_config_sydz'],'post');
	   Bingz_config('upload_config_syname',$_POST['upload_config_syname'],'post');
	   echo"提交成功<br/>";
	 }
   echo "正在自动返回.......<br/><a href=\"admin.php?action=setting&act=upload\">请手动返回</a><br/><meta http-equiv=refresh content='3;url=admin.php?action=setting&act=upload'>";
}else if($act=='renminbi'){
if(Bingz_config('renminbi_config_alipaydualfun_sz') == '1'){$renminbi_config_alipaydualfun_sz='CHECKED';}else{$renminbi_config_alipaydualfun_sza='CHECKED';}
$renminbi_config_alipaydualfun_id=Bingz_config('renminbi_config_alipaydualfun_id');
$renminbi_config_alipaydualfun_key=Bingz_config('renminbi_config_alipaydualfun_key');
$renminbi_config_alipaydualfun_url=Bingz_config('renminbi_config_alipaydualfun_url');
$renminbi_config_alipaydualfun_email=Bingz_config('renminbi_config_alipaydualfun_email');

if(Bingz_config('renminbi_config_zh_alipay_sz') == '1'){$renminbi_config_zh_alipay_sz='CHECKED';}else{$renminbi_config_zh_alipay_sza='CHECKED';}
$renminbi_config_zh_alipay_name=Bingz_config('renminbi_config_zh_alipay_name');
$renminbi_config_zh_alipay_zh=Bingz_config('renminbi_config_zh_alipay_zh');

if(Bingz_config('renminbi_config_zh_zgyh_sz') == '1'){$renminbi_config_zh_zgyh_sz='CHECKED';}else{$renminbi_config_zh_zgyh_sza='CHECKED';}
$renminbi_config_zh_zgyh_name=Bingz_config('renminbi_config_zh_zgyh_name');
$renminbi_config_zh_zgyh_zh=Bingz_config('renminbi_config_zh_zgyh_zh');

if(Bingz_config('renminbi_config_zh_nyyh_sz') == '1'){$renminbi_config_zh_nyyh_sz='CHECKED';}else{$renminbi_config_zh_alipay_sza='CHECKED';}
$renminbi_config_zh_nyyh_name=Bingz_config('renminbi_config_zh_nyyh_name');
$renminbi_config_zh_nyyh_zh=Bingz_config('renminbi_config_zh_nyyh_zh');

echo <<<end
<div class="admin">==支付配置==<br/></div>
<form method="POST" action="admin.php?action=setting&act=renminbiok">
<b>支付宝双功能支付</b><br/>
支付宝开启:
     <input type="radio" $renminbi_config_alipaydualfun_sz name="renminbi_config_alipaydualfun_sz" value="1" />开启
     <input type="radio" $renminbi_config_alipaydualfun_sza name="renminbi_config_alipaydualfun_sz" value="0" />关闭
<br/>
支付宝合作id:<input  class="text" type="text" name="renminbi_config_alipaydualfun_id" value="$renminbi_config_alipaydualfun_id"/><br/>
安全检验码(key):<input  class="text" type="password" name="renminbi_config_alipaydualfun_key" value="$renminbi_config_alipaydualfun_key"/><br/>
支付宝申请网址:<input  class="text" type="text" name="renminbi_config_alipaydualfun_url" value="$renminbi_config_alipaydualfun_url"/><br/>
支付宝邮箱帐户:<input  class="text" type="text" name="renminbi_config_alipaydualfun_email" value="$renminbi_config_alipaydualfun_email"/><br/>
<b>银行账号显示</b><br/>
支付宝开启:
     <input type="radio" $renminbi_config_zh_alipay_sz name="renminbi_config_zh_alipay_sz" value="1" />开启
     <input type="radio" $renminbi_config_zh_alipay_sza name="renminbi_config_zh_alipay_sz" value="0" />关闭
<br/>
支付宝户名:<input  class="text" type="text" name="renminbi_config_zh_alipay_name" value="$renminbi_config_zh_alipay_name"/><br/>
支付宝帐户:<input  class="text" type="text" name="renminbi_config_zh_alipay_zh" value="$renminbi_config_zh_alipay_zh"/><br/>
中国银行开启:
     <input type="radio" $renminbi_config_zh_zgyh_sz name="renminbi_config_zh_zgyh_sz" value="1" />开启
     <input type="radio" $renminbi_config_zh_zgyh_sza name="renminbi_config_zh_zgyh_sz" value="0" />关闭
<br/>
中国银行户名:<input  class="text" type="text" name="renminbi_config_zh_zgyh_name" value="$renminbi_config_zh_zgyh_name"/><br/>
中国银行帐户:<input  class="text" type="text" name="renminbi_config_zh_zgyh_zh" value="$renminbi_config_zh_zgyh_zh"/><br/>

农业银行开启:
     <input type="radio" $renminbi_config_zh_nyyh_sz name="renminbi_config_zh_nyyh_sz" value="1" />开启
     <input type="radio" $renminbi_config_zh_nyyh_sza name="renminbi_config_zh_nyyh_sz" value="0" />关闭
<br/>
农业银行户名:<input  class="text" type="text" name="renminbi_config_zh_nyyh_name" value="$renminbi_config_zh_nyyh_name"/><br/>
农业银行帐户:<input  class="text" type="text" name="renminbi_config_zh_nyyh_zh" value="$renminbi_config_zh_nyyh_zh"/><br/>

<input class="submit" type="submit" name="adminpost" value="提交配置"/>
</form>
end;
}else if($act=='renminbiok'){
   if(!$_POST[adminpost]){
	   echo"提交出错<br/>";
	 }else{
	   Bingz_config('renminbi_config_alipaydualfun_sz',$_POST['renminbi_config_alipaydualfun_sz'],'post');
	   Bingz_config('renminbi_config_alipaydualfun_id',$_POST['renminbi_config_alipaydualfun_id'],'post');
	   Bingz_config('renminbi_config_alipaydualfun_key',$_POST['renminbi_config_alipaydualfun_key'],'post');
	   Bingz_config('renminbi_config_alipaydualfun_url',$_POST['renminbi_config_alipaydualfun_url'],'post');
	   Bingz_config('renminbi_config_alipaydualfun_email',$_POST['renminbi_config_alipaydualfun_email'],'post');

	   Bingz_config('renminbi_config_zh_alipay_sz',$_POST['renminbi_config_zh_alipay_sz'],'post');
	   Bingz_config('renminbi_config_zh_alipay_name',$_POST['renminbi_config_zh_alipay_name'],'post');
	   Bingz_config('renminbi_config_zh_alipay_zh',$_POST['renminbi_config_zh_alipay_zh'],'post');

	   Bingz_config('renminbi_config_zh_zgyh_sz',$_POST['renminbi_config_zh_zgyh_sz'],'post');
	   Bingz_config('renminbi_config_zh_zgyh_name',$_POST['renminbi_config_zh_zgyh_name'],'post');
	   Bingz_config('renminbi_config_zh_zgyh_zh',$_POST['renminbi_config_zh_zgyh_zh'],'post');

	   Bingz_config('renminbi_config_zh_nyyh_sz',$_POST['renminbi_config_zh_nyyh_sz'],'post');
	   Bingz_config('renminbi_config_zh_nyyh_name',$_POST['renminbi_config_zh_nyyh_name'],'post');
	   Bingz_config('renminbi_config_zh_nyyh_zh',$_POST['renminbi_config_zh_nyyh_zh'],'post');
	   echo"提交成功<br/>";
	 }
   echo "正在自动返回.......<br/><a href=\"admin.php?action=setting&act=renminbi\">请手动返回</a><br/><meta http-equiv=refresh content='3;url=admin.php?action=setting&act=renminbi'>";
}else if($act=='systemok'){
   if(!$_POST[adminpost]){
	   echo"提交出错<br/>";
	 }else{
	   Bingz_config('system_config_login_dl',$_POST['system_config_login_dl'],'post');
	   Bingz_config('system_config_login_dlsj',$_POST['system_config_login_dlsj'],'post');
	   Bingz_config('system_config_huancunhtml',$_POST['system_config_huancunhtml'],'post');
	   Bingz_config('system_config_cache',$_POST['system_config_cache'],'post');
	   Bingz_config('system_config_templatessj',$_POST['system_config_templatessj'],'post');
	   Bingz_config('system_config_gzip',$_POST['system_config_gzip'],'post');
	   Bingz_config('system_config_contentgl',$_POST['system_config_contentgl'],'post');
	   Bingz_config('system_config_Error',$_POST['system_config_Error'],'post');
	   Bingz_config('system_config_wap_a',$_POST['system_config_wap_a'],'post');
	   Bingz_config('system_config_wap_b',$_POST['system_config_wap_b'],'post');
	   Bingz_config('system_config_wpc_a',$_POST['system_config_wpc_a'],'post');
	   Bingz_config('system_config_wpc_b',$_POST['system_config_wpc_b'],'post');
	   Bingz_config('system_config_web_a',$_POST['system_config_web_a'],'post');
	   Bingz_config('system_config_web_b',$_POST['system_config_web_b'],'post');
	   echo"提交成功<br/>";
	   deldir('cache/index');
	 }
   echo "正在自动返回.......<br/><a href=\"admin.php?action=setting&act=system\">请手动返回</a><br/><meta http-equiv=refresh content='3;url=admin.php?action=setting&act=system'>";
}else if($act=='system'){
if(Bingz_config('system_config_huancunhtml') == '1'){$system_config_huancunhtml='CHECKED';}else{$system_config_huancunhtmla='CHECKED';}
if(Bingz_config('system_config_login_dl') == '7'){$system_config_login_dla='CHECKED';}elseif(Bingz_config('system_config_login_dl') == '30'){$system_config_login_dlb='CHECKED';}else{$system_config_login_dlc='CHECKED';}
if(Bingz_config('system_config_login_dlsj') == '1'){$system_config_login_dlsjb='CHECKED';}elseif(Bingz_config('system_config_login_dlsj') == '7'){$system_config_login_dlsjc='CHECKED';}elseif(Bingz_config('system_config_login_dlsj') == '30'){$system_config_login_dlsjd='CHECKED';}else{$system_config_login_dlsja='CHECKED';}
$system_config_cache=Bingz_config('system_config_cache');
$system_config_templatessj=Bingz_config('system_config_templatessj');
$system_config_gzip=Bingz_config('system_config_gzip');
$system_config_contentgl=Bingz_config('system_config_contentgl');
$system_config_Error=Bingz_config('system_config_Error');
	
$system_config_wap_a=Bingz_config('system_config_wap_a');
$system_config_wap_b=Bingz_config('system_config_wap_b');
$system_config_wpc_a=Bingz_config('system_config_wpc_a');
$system_config_wpc_b=Bingz_config('system_config_wpc_b');
$system_config_web_a=Bingz_config('system_config_web_a');
$system_config_web_b=Bingz_config('system_config_web_b');

echo <<<end
<div class="admin">==系统配置==<br/></div>
<form method="POST" action="admin.php?action=setting&act=systemok">
静态页面设置
<input type="radio" $system_config_huancunhtml name="system_config_huancunhtml" value="1" />开启
<input type="radio" $system_config_huancunhtmla name="system_config_huancunhtml" value="0" />关闭<br/>
登陆记录删除
<input type="radio" $system_config_login_dla name="system_config_login_dl" value="7" />一星期
<input type="radio" $system_config_login_dlb name="system_config_login_dl" value="30" />一个月
<input type="radio" $system_config_login_dlc name="system_config_login_dl" value="0" />关闭<br/>
会员登陆期限
<input type="radio" $system_config_login_dlsja name="system_config_login_dlsj" value="0" />即时
<input type="radio" $system_config_login_dlsjb name="system_config_login_dlsj" value="1" />一天
<input type="radio" $system_config_login_dlsjc name="system_config_login_dlsj" value="7" />一星期
<input type="radio" $system_config_login_dlsjd name="system_config_login_dlsj" value="30" />一个月<br/>
数据缓存时间
<input type="text" name="system_config_cache" value="$system_config_cache" />多少秒  0 关闭<br/>
模板刷新时间
<input type="text" name="system_config_templatessj" value="$system_config_templatessj" />设置 -1关闭, 0每次, 秒数<br/>
Gzip压缩等级
<input type="text" name="system_config_gzip" value="$system_config_gzip" />0 关闭<br/>
数据内容过滤
<input type="text" name="system_config_contentgl" value="$system_config_contentgl" />用,隔开<br/>
错误报告日志
<input type="text" name="system_config_Error" value="$system_config_Error" /><br/>


网站(wap)顶部:<textarea  class="textarea" type="text" name="system_config_wap_a" >$system_config_wap_a</textarea>
<br/>
网站(wap)底部:<textarea  class="textarea" type="text" name="system_config_wap_b" >$system_config_wap_b</textarea>
<br/>
网站(wpc)顶部:<textarea  class="textarea" type="text" name="system_config_wpc_a" >$system_config_wpc_a</textarea>
<br/>
网站(wpc)底部:<textarea  class="textarea" type="text" name="system_config_wpc_b" >$system_config_wpc_b</textarea>
<br/>
网站(web)顶部:<textarea  class="textarea" type="text" name="system_config_web_a" >$system_config_web_a</textarea>
<br/>
网站(web)底部:<textarea  class="textarea" type="text" name="system_config_web_b" >$system_config_web_b</textarea>
<br/>
<input class="submit" type="submit" name="adminpost" value="修改配置"/>
</form>
end;
}else if($act=='Siteok'){
   if(!$_POST[adminpost]){
	     echo"提交出错<br/>";
	 }else{
	   Bingz_config('Site_config_name',$_POST['Site_config_name'],'post');
	   Bingz_config('Site_config_namej',$_POST['Site_config_namej'],'post');
	   Bingz_config('Site_config_url',$_POST['Site_config_url'],'post');
	   Bingz_config('Site_config_banb',$_POST['Site_config_banb'],'post');
	   Bingz_config('Site_config_fwsz',$_POST['Site_config_fwsz'],'post');
	   Bingz_config('Site_config_fwszts',$_POST['Site_config_fwszts'],'post');
	   Bingz_config('Site_config_jf_name',$_POST['Site_config_jf_name'],'post');
	   Bingz_config('Site_config_jb_name',$_POST['Site_config_jb_name'],'post');
	   Bingz_config('Site_config_yb_name',$_POST['Site_config_yb_name'],'post');
	   
	   Bingz_config('Site_config_rmb_name',$_POST['Site_config_rmb_name'],'post');
	   Bingz_config('Site_config_keywords',$_POST['Site_config_keywords'],'post');
	   Bingz_config('Site_config_description',$_POST['Site_config_description'],'post');
	   Bingz_config('Site_config_index',$_POST['Site_config_index'],'post');
	     echo"提交成功<br/>";
	 }
   echo "正在自动返回.......<br/><a href=\"admin.php?action=setting&act=Site\">请手动返回</a><br/><meta http-equiv=refresh content='3;url=admin.php?action=setting&act=Site'>";
}else if($act =='logo'){
	 $bzwjc=Bingz_upload('logo/','1','1');
   if($bzwjc[1] == '1'){
			echo"<br/>上传成功<br/>";
  		Bingz_config('Site_config_logo','data/logo/'.$bzwjc[2],'post');		    			  	
   }else{
      echo'上传附件：'.$bzwjc[2].'';
   }
   echo "正在自动返回.......<br/><a href=\"admin.php?action=setting&act=Site\">请手动返回</a><br/><meta http-equiv=refresh content='3;url=admin.php?action=setting&act=Site'>";
}else if($act =='Site'){
    $Site_config_logo=Bingz_config('Site_config_logo');

    $Site_config_name=Bingz_config('Site_config_name');
    $Site_config_namej=Bingz_config('Site_config_namej');
    $Site_config_url=Bingz_config('Site_config_url');
    if(Bingz_config('Site_config_banb') == 'wap'){$Site_config_banb='CHECKED';}elseif(Bingz_config('Site_config_banb') == 'wpc'){$Site_config_banba='CHECKED';}elseif(Bingz_config('Site_config_banb') == 'web'){$Site_config_banbb='CHECKED';}
    if(Bingz_config('Site_config_fwsz') == '1'){$Site_config_fwsz='CHECKED';}else{$Site_config_fwsza='CHECKED';}
    
    $Site_config_fwszts=Bingz_config('Site_config_fwszts');
    $Site_config_jf_name=Bingz_config('Site_config_jf_name');
    $Site_config_jb_name=Bingz_config('Site_config_jb_name');
    $Site_config_yb_name=Bingz_config('Site_config_yb_name');
    
    $Site_config_rmb_name=Bingz_config('Site_config_rmb_name');
    $Site_config_keywords=Bingz_config('Site_config_keywords');
    $Site_config_description=Bingz_config('Site_config_description');
	 	  
if(Bingz_config('Site_config_index') == 'index'){$Site_config_indexa='selected="selected"';}elseif(Bingz_config('Site_config_index') == 'forum'){$Site_config_indexb='selected="selected"';}elseif(Bingz_config('Site_config_index') == 'link'){$Site_config_indexc='selected="selected"';}

echo <<<end
<div class="admin">==网站设置==<br/></div>
站点logo: <img src="$Site_config_logo" width="100" height="52" /><br/>
<form method="POST" action="admin.php?action=setting&act=logo" enctype="multipart/form-data" >
<input type="file" name="upfile" />
<input class="submit" type="submit" value="上传logo" name="b1" />
</form><br/>

<form method="POST" action="admin.php?action=setting&act=Siteok">
站点名称:<input  class="text" type="text" name="Site_config_name" value="$Site_config_name"/><br/>
站点简称:<input  class="text" type="text" name="Site_config_namej" value="$Site_config_namej"/><br/>
站点域名:<input  class="text" type="text" name="Site_config_url" value="$Site_config_url"/><br/>
默认版本:
     <input type="radio" $Site_config_banb name="Site_config_banb" value="wap" />wap
     <input type="radio" $Site_config_banba name="Site_config_banb" value="wpc" />wpc
     <input type="radio" $Site_config_banbb name="Site_config_banb" value="web" />web
<br/>
默认首页:
     <select name="Site_config_index">
     <option value="index" $Site_config_indexa >首页-index</option>
     <option value="forum" $Site_config_indexb >论坛-forum</option>
     <option value="link" $Site_config_indexc >友链-link</option>
end;
	 	  $sql=$db->query('plugin'," ");
      while($row=mysql_fetch_array($sql)){
	        $Site_config_index='';
	        if(Bingz_config('Site_config_index') == 'plugin&'.$row[identifier].''){$Site_config_index=$Site_config_index='selected="selected"';}
	        echo '<option value="plugin&'.$row[identifier].'" '.$Site_config_index.' >插件-'.$row[name].'</option>';
      }


echo <<<end
     </select>
<br/>
访问设置:
     <input type="radio" $Site_config_fwsza name="Site_config_fwsz" value="0" />正常访问
     <input type="radio" $Site_config_fwsz name="Site_config_fwsz" value="1" />关闭访问
<br/>
关闭提示:<input  class="text" type="text" name="Site_config_fwszts" value="$Site_config_fwszts"/><br/>
经验名称:<input  class="text" type="text" name="Site_config_jf_name" value="$Site_config_jf_name"/><br/>
金币名称:<input  class="text" type="text" name="Site_config_jb_name" value="$Site_config_jb_name"/><br/>
游币名称:<input  class="text" type="text" name="Site_config_yb_name" value="$Site_config_yb_name"/><br/>
人民币称:<input  class="text" type="text" name="Site_config_rmb_name" value="$Site_config_rmb_name"/><br/>

站关键字:<textarea  class="textarea" type="text" name="Site_config_keywords" >$Site_config_keywords</textarea>
<br/>
站点描述:<textarea  class="textarea" type="text" name="Site_config_description" >$Site_config_description</textarea>
<br/>
<input class="submit" type="submit" name="adminpost" value="修改配置"/>
</form>
end;
}else{
   echo "操作出错！<br/>正在自动返回.......<br/><a href=\"admin.php?\">请手动返回</a><br/><meta http-equiv=refresh content='3;url=admin.php?'>";
}
?>